package com.example.demo.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author 张露晨
 * @date 2017/9/27 15:52.
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Person  extends Model<Person> {
    /**
     * 用户id
     */
    private String id;

    /**
     * 姓名
     */
    @TableField("user_name")
    private String name;

    /**
     * 性别
     */
    private String sex;

    /**
     * 年龄
     */
    private Integer age;

    public Person(String name, String sex, Integer age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
